package itcast.service.impl;

import itcast.dao.NoticeDao;
import itcast.dao.impl.NoticeDaoImpl;
import itcast.domain.Notice;
import itcast.service.NoticeService;

import java.util.List;

public class NoticeServiceImpl implements NoticeService {
    NoticeDao noticeDao=new NoticeDaoImpl();

    @Override
    public void insertNotice(Notice notice) {
        noticeDao.inser_tNotice(notice);
    }
    //找到单个发布的公告


    @Override
    public Notice findNotice(String id) {
        return noticeDao.findNoticeByID(id);
    }
    //学生查询多个公告数据

    @Override
    public List<Notice> findAll() {
        return noticeDao.findAll();
    }

    //根据公告编号删除公告

    @Override
    public void delNotice(String notice_id) {
    noticeDao.delNotice_id(Integer.parseInt(notice_id));
    }
}
